package yunquan.wang.base.dao.springdata.audit;

import org.springframework.data.domain.AuditorAware;
import org.springframework.security.core.userdetails.User;

import yunquan.wang.base.spring.security.SpringSecurityUtils;

/**
 * Dummy implementation of {@link AuditorAware}. It will return the configured {@link AuditableUser} as auditor on every
 * call to {@link #getCurrentAuditor()}. Normally you would access the applications security subsystem to return the
 * current user.
 * 
 * @author Oliver Gierke
 */
public class AuditorAwareImpl implements AuditorAware<User> {

 
	/*
	 * (non-Javadoc)
	 * @see org.springframework.data.domain.AuditorAware#getCurrentAuditor()
	 */
	public User getCurrentAuditor() {
		return SpringSecurityUtils.getCurrentUser();
	}
}
